package nextoffer;

/**
 * @author ：szq
 * @date ：Created in 2022/4/3 10:20
 * @description：剑指 Offer 58 - I. 翻转单词顺序
 * @modified By：
 * @version: $
 */
public class flipTheWordOrder {

    public static void main(String[] args) {
        String s= "hello  world! abbb 23 abbb   0";

        String[] strArr = s.split("ab{1,3}");
        for (String s1:strArr
             ) {
            System.out.println(s1);
        }

        String res1="";
        for(int i = strArr.length-1 ;i>=0;i--)
        {
            if(strArr[i].equals(""))continue;
            if(i!=strArr.length-1)res1+=" ";
            res1+=strArr[i];

        }

    }
}
